using Firebase.Analytics;
using UnityEngine;

public class Tracking : MonoBehaviour
{
	public static Tracking instance;

	public bool FirstItemIAP
	{
		get
		{
			return (PlayerPrefs.GetInt("FirstItemIAP", 0) != 0) ? true : false;
		}
		set
		{
			PlayerPrefs.SetInt("FirstItemIAP", value ? 1 : 0);
		}
	}

	public bool FirstIAPFloor
	{
		get
		{
			return (PlayerPrefs.GetInt("FirstIAPFloor", 0) != 0) ? true : false;
		}
		set
		{
			PlayerPrefs.SetInt("FirstIAPFloor", value ? 1 : 0);
		}
	}

	public int SectionTime
	{
		get
		{
			return PlayerPrefs.GetInt("SectionTime", 1);
		}
		set
		{
			PlayerPrefs.SetInt("SectionTime", value);
		}
	}

	public int ActiveTime
	{
		get
		{
			return PlayerPrefs.GetInt("ActiveTime", 0);
		}
		set
		{
			PlayerPrefs.SetInt("ActiveTime", value);
		}
	}

	private void Awake()
	{
		if (instance == null)
		{
			instance = this;
		}
		else if (instance != this)
		{
			UnityEngine.Object.Destroy(base.gameObject);
		}
		Object.DontDestroyOnLoad(base.gameObject);
	}

	public void FB_TutorialComplete()
	{
		FirebaseAnalytics.LogEvent("TutorialComplete");
	}

	public void FB_FloorUnlocked(string mine, int floor)
	{
		FirebaseAnalytics.LogEvent("FloorUnlocked", mine, floor);
	}

	public void FB_CompleteAdvertisement(string position)
	{
		FirebaseAnalytics.LogEvent("CompleteAdvertisement", "Position", position);
	}

	public void FB_FirstInAppPurchaseFloor(int floor)
	{
		FirebaseAnalytics.LogEvent("FirstInAppPurchaseFloor", "Floor", floor);
	}

	public void FB_FirstItemInAppPurchase(string item, string value)
	{
		FirebaseAnalytics.LogEvent("FirstItemInAppPurchase", item, value);
	}

	public void FB_ActiveTime(int activeTime)
	{
		FirebaseAnalytics.SetUserProperty("ActiveTime", activeTime.ToString());
	}

	public void FB_SectionTime(int count)
	{
		FirebaseAnalytics.SetUserProperty("SectionTime", count.ToString());
	}

	public void FB_CashItem(string category, string value)
	{
		FirebaseAnalytics.LogEvent("CashItem", category, value);
	}
}
